#ifndef FARGUMENT_H
#define FARGUMENT_H

#include "../STL_includes.h"

#include "../Typedefs.h"
#include "../Enums.h"
#include "MVariable.h"
#include "CurrentOptions.h"

#include "../Static_classes/Counter.h"
#include "../Static_classes/FunctionAnalyzer/FunctionAnalyzer.h"
#include "../Technical/RuntimeErrorClass.h"

namespace STC_calc
{
/*
* The FArgument class is universal
* class that is be using in MathFunction
* It can contain a variable, a subfunction
* xor a value. Type is be choosing automatically
*/
class FArgument
		//:virtual private VarSpace
{
private:

	long double value;
	std::shared_ptr<MathFunction> func;
	std::shared_ptr<MVariable> var;
    std::shared_ptr<MConstant> constant;
	Enums::FArgument_variants arg_type;

	void make_var(const std::string& str);
    void make_const(const std::string& str);
	void make_func(const std::string& str);
	void make_val(const std::string& str);

	bool can_be_variable(const std::string& str);
    bool can_be_constant(const std::string& str);
	std::string cut_var_name(const std::string& str);
public:
	FArgument(const std::string& str);
    FArgument(const FArgument& that);
    void operator =(const FArgument& that);
	~FArgument();
	long double operator()();
    bool operator ==(const FArgument& that);
    bool operator !=(const FArgument& that);
};
}
#endif // FARGUMENT_H
